package com.example.ymllist;

import java.util.Arrays;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chaird
 * @create 2020-12-25 21:28
 */
@SpringBootApplication
@RestController
public class App {


    public static void main(String[] args) {
        SpringApplication.run(App.class, args);
    }



    @Autowired
    private WhiteListConfig whiteListConfig;

    @GetMapping("/getWhileList")
    public Object getWhileList() {
        return whiteListConfig.getUsers();

    }


    @Autowired
    private WhiteArrayConfig whiteArrayConfig;

    @GetMapping("/getWhiteArray")
    public Object getWhiteArray() {
        String[] users = whiteArrayConfig.getUsers();
        Arrays.stream(users).forEach(System.out::println);
        return whiteArrayConfig.getUsers();

    }


    @Autowired
    private StudentProperties studentProperties;

    @GetMapping("/studentProperties")
    public Object studentProperties() {
        return studentProperties.toString();

    }
    @Autowired
    private TeacherMapConfig teacherMapConfig;

    @GetMapping("/teacherMapConfig")
    public Object teacherMapConfig() {
        teacherMapConfig.getTeacher().entrySet().forEach(System.out::println);
        return teacherMapConfig.getTeacher();

    }





}

